<?php
include_once("module/product/includes/plugin_order_class.php");
$order=new order();
//---------------------------------------------------------
if(!empty($_POST['payaction'])&&$_POST['payaction']=='pay')
{   
    $sql="select pay_password from ".ALLUSER."   where userid=$buid";
	$db->query($sql);
	$pay_password=$db->fetchField('pay_password');
    if(!empty($pay_password)&&$pay_password!=md5($_POST['password']))
	{
	   $admin->msg('main.php?menu=trade&action=admin_accounts_pay&menu=trade','支付密码不正确');
	}
	$re=$order->orderpayupdate();
	if($re)
		msg("main.php?action=m&m=product&s=admin_buyorder&menu=$_GET[menu]");
	else
		$admin->msg('main.php?menu=trade&action=admin_accounts_pay&menu=trade','余额不足，请先充值');
}
if(!empty($_GET['id'])&&is_numeric($_GET['id']))
	$tpl->assign("orderpay",$order->orderpay($_GET['id']));
//----------------------------------------------------------
$tpl->assign("config",$config);
$tpl->assign("lang",$lang);
$output=tplfetch("admin_orderpay.htm");
?>